# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Paul Kilar <pkilar@gmail.com>
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
# Maintainer: Paul Kilar <pkilar@gmail.com>
pkgname=py3-pystache
_realname=pystache
pkgver=0.6.5
pkgrel=1
pkgdesc="Pystache is a Python implementation of Mustache"
url="https://pypi.org/project/pystache"
arch="noarch"
license="MIT"
replaces="py-pystache" # For backwards compatibility
provides="py-pystache=$pkgver-r$pkgrel" # For backwards compatibility
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-installer py3-wheel py3-setuptools_scm"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_realname:0:1}/$_realname/$_realname-$pkgver.tar.gz"
builddir="$srcdir"/$_realname-$pkgver

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver"
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
56b6e5ce6bc95aa2d5d77172d75d3fa2a37cf0927259f9136d77d9a73ce26384d72b3dd158577d247e1cbbe887916d7bc7982b6d8df2d1c0411dc33c93be6e1c  pystache-0.6.5.tar.gz
"
